package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.DocIntentionOrder;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.IntentionOrderSearchDTO;
import com.chenfan.mcn.model.vo.*;
import org.apache.ibatis.annotations.Param;
import com.chenfan.mcn.model.dto.AnchorSchedulingSearchDTO;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 意向单 Mapper 接口
 * </p>
 *
 * @author wulg
 * @since 2022-10-28
 */
public interface DocIntentionOrderMapper extends EnhancedBaseMapper<DocIntentionOrder> {

    /**
     * 分页查询意向单
     * @param mcnPage
     * @param dto
     * @return
     */
    Page<IntentionOrderListVO> getIntentionOrderPage(McnPage<IntentionOrderListVO> mcnPage, @Param("dto") IntentionOrderSearchDTO dto);

    /**
     * 根据条件获取博主排期数据
     * @param searchDTO
     * @return
     */
    List<DocIntentionOrder> getAnchorSchedulingData(@Param("dto") AnchorSchedulingSearchDTO searchDTO);

    /**
     * 意向询单（分页）
     * @param page
     * @param searchDTO
     * @return
     */
    Page<DocIntentionOrder> inquiryPage(Page<DocIntentionOrder> page, @Param("dto") AnchorSchedulingSearchDTO searchDTO);

    /**
     * 根据条件分组统计各状态意向单数量
     * @param searchDTO
     * @return
     */
    List<IntentionOrderStatusSummaryVO> getStatusSummaryList(@Param("dto") AnchorSchedulingSearchDTO searchDTO);

    /**
     * 统计意向单金额
     * @param searchDTO
     * @return
     */
    BigDecimal getTotalOrderAmount(@Param("dto") AnchorSchedulingSearchDTO searchDTO);

    /**
     *根据条件获取意向单
     * @param searchDTO
     * @return
     */
    List<IntentionOrderExportVO> exportIntentionOrder(@Param("dto") IntentionOrderSearchDTO searchDTO);

    /**
     * 模糊获取意向单编号
     * @param size
     * @param likeCode
     * @param searchDTO
     * @return
     */
    List<String> getIntentionOrderCodes(@Param("size") Integer size, @Param("likeCode") String likeCode,@Param("dto") IntentionOrderSearchDTO searchDTO);

    /**
     * 按照状态统计意向单数量
     * @param searchDTO
     * @return
     */
    IntentionOrderStatusStatisVO getCountByStatus(@Param("dto") IntentionOrderSearchDTO searchDTO);

    /**
     * 获取意向单列表查询金额汇总
     * @param searchDTO
     * @return
     */
    IntentionOrderAmountSummaryVO getAmountSummary(@Param("dto") IntentionOrderSearchDTO searchDTO);
}
